#include<stdio.h>

int main()
{
	int n,flag=3,sum1=0,sum2=0,sum3=0;
	scanf("%d",&n);
	if(n%2==1) printf("%d %d ",n/2+1,n/2);
	else printf("%d %d ",n/2,n/2);
	for(;flag<=n;flag++){
		if(flag%3==0) sum1++;
		if(flag%5==0) sum2++;
		if(flag%7==0) sum3++;
	}
	printf("%d %d %d",sum1,sum2,sum3);
	return 0;
}
